window.onload=function(){
	/* 留言板缩放效果 */
	document.getElementById("news-css-message-button").onclick=function(){
		var obj=document.getElementById("news-css-message-board");
		obj.style.display="none";
	};
	document.getElementById("news-css-message-buttons").onclick=function(){
		var obj=document.getElementById("news-css-message-board");
		obj.style.display="block";
	};
	document.getElementById("news-css-service").onclick=function(){
		var obj1=document.getElementById("news-css-message-board");
		var obj2=document.getElementById("news-css-message-board-reduce");
		var obj3=document.getElementById("news-css-message-board-center");
		obj1.style.display="none";
		obj2.style.display="none";
		obj3.style.display="block";
	};
	document.getElementById("news-css-message-buttonss").onclick=function(){
		var obj1=document.getElementById("news-css-message-board");
		var obj2=document.getElementById("news-css-message-board-reduce");
		var obj3=document.getElementById("news-css-message-board-center");
		obj1.style.display="none";
		obj2.style.display="block";
		obj3.style.display="none";
	};
	 /* 导航栏hover效果 */
	$(function() {
	            var originalCur = $("#news-css-mainbav li.news-css-mainbav-now-css");
	            $("#news-css-mainbav li").mousemove(function () {
	                $("#news-css-mainbav li").removeClass("news-css-mainbav-now-css");
	                $(this).addClass("news-css-mainbav-now-css");
	            });
	            $("#news-css-mainbav li").mouseleave(function () {
	                $(this).removeClass("news-css-mainbav-now-css");
	                originalCur.addClass("news-css-mainbav-now-css");
	            });
	        });
			
			// 分页
			var pageBar = new Vue({
			    el: '.page-bar',
			    data: {
			        all: 8, //总页数
			        cur: 6//当前页码
			    },
			    watch: {
			        cur: function(oldValue , newValue){
			            console.log(arguments);
			        }
			    },    
			     methods: {
			        btnClick: function(data){
			            if(data != this.cur){
			                this.cur = data;
			            }
						window.location.href="news-企业新闻-"+this.cur+".html";
			        },
			        pageClick: function(){
			            console.log('现在在'+this.cur+'页');
			        }
			    },
			    computed: {
			        indexs: function(){
			          var left = 1;
			          var right = this.all;
			          var ar = [];
			          if(this.all>= 5){
			          	//这里最大范围从3到6，如果到达7，那么下边加2变成9，已经超过最大的范围值
			            if(this.cur > 3 && this.cur < this.all-1){
			            	//以4为参考基准，左面加2右边加2
			                    left = this.cur - 2
			                    right = this.cur + 2
			            }else{
			                if(this.cur<=3){
			                    left = 1
			                    right = 5
			                }else{
			                    right = this.all
			                    left = this.all -4
			                }
			            }
			         }
			        while (left <= right){
			            ar.push(left)
			            left ++
			        }
			        console.log(ar);
			        return ar
			       }
			    }
			})
}